package com.interfaces;

import com.drawables.LevelTile;

import android.graphics.Bitmap;
import android.graphics.Color;
import android.util.Log;

public abstract class Collidable extends AybivedDrawable implements Updateable{


	//TODO make protected
	public Bitmap mask;
	
	public Collidable()
	{
		super();
	}
	
	public boolean checkMaskPixel(int x,int y) {
		
		if( mask.getHeight() < y)
			y = mask.getHeight()-1;
		if( mask.getWidth() < x)
			x = mask.getWidth()-1;
		if( y < 0 ) y = 0;
		if( x < 0 ) x = 0;
		try{Log.d("sa", "x: " + String.valueOf(x) + " y: " + String.valueOf(y));
			if(mask.getPixel(x, y) == Color.BLACK){
				int bla;
				bla = 3;
				return true;
			}
		}
		catch( Exception e)
		{
			Log.d("Collison error Collidable::checkMaskPixel()", e.getMessage());
		}
		return false;
	}
	
	
}
